{% extends "layout.html" %}

{% block title %}foursquare-latitude: Matcher{% endblock title %}
{% block main %}

<table width="100%">
  <tr>
    <td>
      <h2>Venue</h2>
	<h3>
        <a href="http://foursquare.com/venue/{{ venue.id }}">
          {% if venue.primarycategory.iconurl %}
          <img src="{{ venue.primarycategory.iconurl }}" height="30" width="30" />
          {% else %}
          <img src="http://foursquare.com/img/categories/building/default.png" height="30" width="30" />
          {% endif %}
          <a href="http://foursquare.com/venue/{{ venue.id }}">{{ venue.name }}</a>
        </h3>
        <dl>
          <dt>id</dt><dd>{{ venue.id }}</dd>
          <dt>name</dt><dd>{{ venue.name }}</dd>
          <dt>address</dt><dd>{{ venue.address }} {{ venue.city }}, {{ venue.state }} {{ venue.zip }}</dd>
          <dt>phone</dt><dd>{{ venue.phone }}</dd>
          <dt>geolat</dt><dd>{{ venue.geolat }}</dd>
          <dt>geolong</dt><dd>{{ venue.geolong }}</dd>
        </dl>
      </td>

      {% if match %}
      <td>
        <h2>Match</h2>
	<h3>
        <a href="{{ match.url }}">
          {% if match.icon %}
          <img src="{{ match.icon }}" height="30" width="30" />
          {% else %}
          <img src="http://foursquare.com/img/categories/building/default.png" height="30" width="30" />
          {% endif %}
        </a>
        <a href="{{ match.url }}">{{ match.name }}</a>
        </h3>
        <dl>
          <dt>id</dt><dd>{{ match.id }}</dd>
          <dt>name</dt><dd>{{ match.name }}</dd>
          <dt>formatted_address</dt><dd>{{ match.formatted_address }}</dd>
          <dt>phone</dt><dd>{{ match.formatted_phone_number }}</dd>
          <dt>geolat</dt><dd>{{ match.geometry.location.lat }}</dd>
          <dt>geolong</dt><dd>{{ match.geometry.location.lng }}</dd>
        </dl>
	</h3>
      </td>
      {% endif %}
    </tr>
  </table>
  <span width="100%">place: {{ match.reference }}</span>
  <br />

  <h2>Places</h2>
  <ul>
  {% for place in places %}
    <li>
      <a href="{{ place.url }}">
      {% if place.icon %}
        <img src="{{ place.icon }}" />
      {% else %}
        <img src="http://foursquare.com/img/categories/building/default.png" />
      {% endif %}
      </a>
      <a href="{{ place.url }}">{{ place.name }}</a>
        <dl>
          <dt>id</dt><dd>{{ place.id }}</dd>
          <dt>name</dt><dd>{{ place.name }}</dd>
          <dt>vicinity</dt><dd>{{ place.vicinity }}</dd>
          <dt>types</dt><dd>{{ place.types }}</dd>
          <dt>phone</dt><dd>{{ place.formatted_phone_number }}</dd>
          <dt>formatted_address</dt><dd>{{ place.formatted_address }}</dd>
          <dt>geometry</dt><dd>{{ place.geometry }}</dd>
          <dt>url</dt><dd>{{ place.url }}</dd>
        </dl>
    </li>
  {% endfor %}
  </ul>
  <h3>Attributions</h3>
  {% for html_attribution in html_attributions %}
    <li>{{ html_attribution}}</li>
  {% endfor %}

<script src="static/js/main.js"></script>

{% endblock main %}

{% block sidebar_content %}
{% endblock sidebar_content %}


{% block bottom_block %}
{% endblock bottom_block %}
